{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "c85902b4-35c8-4720-ae22-201e86df5989",
   "metadata": {},
   "outputs": [],
   "source": [
    "import comet_ml\n",
    "import torch\n",
    "import utils\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "b5bbbc00-a373-4c9a-8063-105828d79618",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\u001b[1;38;5;214mCOMET WARNING:\u001b[0m comet_ml.init() is deprecated and will be removed soon. Please use comet_ml.login()\n"
     ]
    }
   ],
   "source": [
    "comet_ml.init(project_name='baseline_yolov5s_70%train&&30%test')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "251424b7-3764-4318-9d68-d12e674d845e",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "YOLOv5 🚀 2bde9db5 Python-3.10.8 torch-2.1.2+cu118 CUDA:0 (NVIDIA GeForce RTX 3080, 20181MiB)\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Setup complete ✅ (128 CPUs, 503.5 GB RAM, 16.0/30.0 GB disk)\n"
     ]
    }
   ],
   "source": [
    "display = utils.notebook_init()  # checks"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0fafe7ba-294f-440d-9589-90ed41b6e5d0",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "92946cbc-b61f-4cce-a925-3f889ce1e6b2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[34m\u001b[1mtrain: \u001b[0mweights=yolov5s.pt, cfg=models/yolov5s_kitti.yaml, data=data/kitti.yaml, hyp=data/hyps/hyp.scratch-low.yaml, epochs=16, batch_size=16, imgsz=640, rect=False, resume=False, nosave=False, noval=False, noautoanchor=False, noplots=False, evolve=None, evolve_population=data/hyps, resume_evolve=None, bucket=, cache=None, image_weights=False, device=, multi_scale=False, single_cls=False, optimizer=SGD, sync_bn=False, workers=8, project=runs/train, name=exp, exist_ok=False, quad=False, cos_lr=False, label_smoothing=0.0, patience=100, freeze=[0], save_period=-1, seed=0, local_rank=-1, entity=None, upload_dataset=False, bbox_interval=1, artifact_alias=latest, ndjson_console=False, ndjson_file=False\n",
      "\u001b[34m\u001b[1mgithub: \u001b[0m⚠️ YOLOv5 is out of date by 2882 commits. Use 'git pull ultralytics master' or 'git clone https://github.com/ultralytics/yolov5' to update.\n",
      "YOLOv5 🚀 2bde9db5 Python-3.10.8 torch-2.1.2+cu118 CUDA:0 (NVIDIA GeForce RTX 3080, 20181MiB)\n",
      "\n",
      "\u001b[34m\u001b[1mhyperparameters: \u001b[0mlr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=0.05, cls=0.5, cls_pw=1.0, obj=1.0, obj_pw=1.0, iou_t=0.2, anchor_t=4.0, fl_gamma=0.0, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0, copy_paste=0.0\n",
      "\u001b[34m\u001b[1mTensorBoard: \u001b[0mStart with 'tensorboard --logdir runs/train', view at http://localhost:6006/\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m Experiment is live on comet.com \u001b[38;5;39mhttps://www.comet.com/nagasaki-soyorin/baseline-yolov5s-70-train-30-test/6d66f03bc72d4b6fad533a18650f97a3\u001b[0m\n",
      "\n",
      "\n",
      "                 from  n    params  module                                  arguments                     \n",
      "  0                -1  1      3520  models.common.Conv                      [3, 32, 6, 2, 2]              \n",
      "  1                -1  1     18560  models.common.Conv                      [32, 64, 3, 2]                \n",
      "  2                -1  1     18816  models.common.C3                        [64, 64, 1]                   \n",
      "  3                -1  1     73984  models.common.Conv                      [64, 128, 3, 2]               \n",
      "  4                -1  2    115712  models.common.C3                        [128, 128, 2]                 \n",
      "  5                -1  1    295424  models.common.Conv                      [128, 256, 3, 2]              \n",
      "  6                -1  3    625152  models.common.C3                        [256, 256, 3]                 \n",
      "  7                -1  1   1180672  models.common.Conv                      [256, 512, 3, 2]              \n",
      "  8                -1  1   1182720  models.common.C3                        [512, 512, 1]                 \n",
      "  9                -1  1    656896  models.common.SPPF                      [512, 512, 5]                 \n",
      " 10                -1  1    131584  models.common.Conv                      [512, 256, 1, 1]              \n",
      " 11                -1  1         0  torch.nn.modules.upsampling.Upsample    [None, 2, 'nearest']          \n",
      " 12           [-1, 6]  1         0  models.common.Concat                    [1]                           \n",
      " 13                -1  1    361984  models.common.C3                        [512, 256, 1, False]          \n",
      " 14                -1  1     33024  models.common.Conv                      [256, 128, 1, 1]              \n",
      " 15                -1  1         0  torch.nn.modules.upsampling.Upsample    [None, 2, 'nearest']          \n",
      " 16           [-1, 4]  1         0  models.common.Concat                    [1]                           \n",
      " 17                -1  1     90880  models.common.C3                        [256, 128, 1, False]          \n",
      " 18                -1  1    147712  models.common.Conv                      [128, 128, 3, 2]              \n",
      " 19          [-1, 14]  1         0  models.common.Concat                    [1]                           \n",
      " 20                -1  1    296448  models.common.C3                        [256, 256, 1, False]          \n",
      " 21                -1  1    590336  models.common.Conv                      [256, 256, 3, 2]              \n",
      " 22          [-1, 10]  1         0  models.common.Concat                    [1]                           \n",
      " 23                -1  1   1182720  models.common.C3                        [512, 512, 1, False]          \n",
      " 24      [17, 20, 23]  1     35061  models.yolo.Detect                      [8, [[10, 13, 16, 30, 33, 23], [30, 61, 62, 45, 59, 119], [116, 90, 156, 198, 373, 326]], [128, 256, 512]]\n",
      "YOLOv5s_kitti summary: 214 layers, 7041205 parameters, 7041205 gradients, 16.0 GFLOPs\n",
      "\n",
      "Transferred 342/349 items from yolov5s.pt\n",
      "\u001b[34m\u001b[1mAMP: \u001b[0mchecks passed ✅\n",
      "\u001b[34m\u001b[1moptimizer:\u001b[0m SGD(lr=0.01) with parameter groups 57 weight(decay=0.0), 60 weight(decay=0.0005), 60 bias\n",
      "\u001b[34m\u001b[1malbumentations: \u001b[0m1 validation error for InitSchema\n",
      "size\n",
      "  Field required [type=missing, input_value={'height': 640, 'width': ...'mask_interpolation': 0}, input_type=dict]\n",
      "    For further information visit https://errors.pydantic.dev/2.10/v/missing\n",
      "\u001b[34m\u001b[1mtrain: \u001b[0mScanning /root/autodl-tmp/datasets/kitti/labels/train... 4189 images, 0 b\u001b[0m\n",
      "\u001b[34m\u001b[1mtrain: \u001b[0mNew cache created: /root/autodl-tmp/datasets/kitti/labels/train.cache\n",
      "\u001b[34m\u001b[1mval: \u001b[0mScanning /root/autodl-tmp/datasets/kitti/labels/val... 1048 images, 0 backg\u001b[0m\n",
      "\u001b[34m\u001b[1mval: \u001b[0mNew cache created: /root/autodl-tmp/datasets/kitti/labels/val.cache\n",
      "\n",
      "\u001b[34m\u001b[1mAutoAnchor: \u001b[0m4.81 anchors/target, 0.999 Best Possible Recall (BPR). Current anchors are a good fit to dataset ✅\n",
      "Plotting labels to runs/train/exp/labels.jpg... \n",
      "Image sizes 640 train, 640 val\n",
      "Using 8 dataloader workers\n",
      "Logging results to \u001b[1mruns/train/exp\u001b[0m\n",
      "Starting training for 16 epochs...\n",
      "\n",
      "      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size\n",
      "       0/15      3.65G    0.08069    0.04761    0.03296        128        640: 1\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       1048       5675      0.736      0.129       0.13     0.0486\n",
      "\n",
      "      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size\n",
      "       1/15      3.65G    0.06426    0.04004    0.02261        133        640: 1\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       1048       5675      0.198      0.347      0.204     0.0901\n",
      "\n",
      "      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size\n",
      "       2/15      3.65G    0.05873    0.03866    0.01955        131        640: 1\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       1048       5675      0.512      0.379      0.319      0.157\n",
      "\n",
      "      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size\n",
      "       3/15      3.65G    0.05237    0.03753     0.0163        108        640: 1\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       1048       5675      0.641      0.441      0.428      0.214\n",
      "\n",
      "      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size\n",
      "       4/15      3.65G    0.04792    0.03621    0.01409        156        640: 1\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       1048       5675      0.703      0.482      0.502      0.253\n",
      "\n",
      "      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size\n",
      "       5/15      3.65G    0.04477    0.03548    0.01282        123        640: 1\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       1048       5675      0.716      0.498      0.564      0.285\n",
      "\n",
      "      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size\n",
      "       6/15      3.65G     0.0426    0.03455    0.01139        174        640: 1\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       1048       5675      0.633      0.609      0.627      0.345\n",
      "\n",
      "      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size\n",
      "       7/15      3.65G    0.04098    0.03351    0.01026        166        640: 1\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       1048       5675      0.727       0.59      0.663      0.347\n",
      "\n",
      "      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size\n",
      "       8/15      3.65G    0.03947    0.03349   0.009246        152        640: 1\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       1048       5675      0.768       0.64      0.711      0.392\n",
      "\n",
      "      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size\n",
      "       9/15      3.65G    0.03822    0.03289    0.00865        136        640: 1\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       1048       5675       0.73      0.623      0.694      0.398\n",
      "\n",
      "      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size\n",
      "      10/15      3.65G    0.03717    0.03236   0.007696        134        640: 1\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       1048       5675      0.775      0.653      0.725      0.419\n",
      "\n",
      "      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size\n",
      "      11/15      3.65G    0.03588    0.03143   0.007078        182        640: 1\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       1048       5675      0.814      0.686      0.762      0.452\n",
      "\n",
      "      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size\n",
      "      12/15      3.65G    0.03501    0.03148   0.006568        128        640: 1\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       1048       5675      0.802      0.736      0.797       0.48\n",
      "\n",
      "      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size\n",
      "      13/15      3.65G    0.03373    0.03045   0.006001        112        640: 1\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       1048       5675      0.819       0.72      0.792      0.481\n",
      "\n",
      "      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size\n",
      "      14/15      3.65G    0.03284    0.03025   0.005696        151        640: 1\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       1048       5675      0.844      0.722      0.794      0.491\n",
      "\n",
      "      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size\n",
      "      15/15      3.65G    0.03234    0.03013   0.005394        132        640: 1\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       1048       5675       0.87      0.733      0.812      0.505\n",
      "\n",
      "16 epochs completed in 0.174 hours.\n",
      "Optimizer stripped from runs/train/exp/weights/last.pt, 14.3MB\n",
      "Optimizer stripped from runs/train/exp/weights/best.pt, 14.3MB\n",
      "\n",
      "Validating runs/train/exp/weights/best.pt...\n",
      "Fusing layers... \n",
      "YOLOv5s_kitti summary: 157 layers, 7031701 parameters, 0 gradients, 15.8 GFLOPs\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       1048       5675      0.867      0.734      0.812      0.505\n",
      "                   Car       1048       4012      0.936      0.856      0.941       0.68\n",
      "                   Van       1048        431      0.899      0.764      0.879      0.625\n",
      "                 Truck       1048        166      0.934       0.85      0.909      0.654\n",
      "                  Tram       1048         56      0.843      0.893      0.914      0.603\n",
      "            Pedestrian       1048        618      0.902      0.604      0.748      0.376\n",
      "        Person_sitting       1048         20      0.776        0.6      0.606      0.249\n",
      "               Cyclist       1048        234      0.824      0.722      0.794      0.445\n",
      "                  Misc       1048        138      0.818      0.587      0.705      0.408\n",
      "Results saved to \u001b[1mruns/train/exp\u001b[0m\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m ---------------------------------------------------------------------------------------\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m Comet.ml Experiment Summary\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m ---------------------------------------------------------------------------------------\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m   Data:\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     display_summary_level : 1\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     name                  : exp\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     url                   : \u001b[38;5;39mhttps://www.comet.com/nagasaki-soyorin/baseline-yolov5s-70-train-30-test/6d66f03bc72d4b6fad533a18650f97a3\u001b[0m\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m   Metrics [count] (min, max):\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Car_f1                         : 0.8944080640444769\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Car_false_positives            : 235.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Car_mAP@.5                     : 0.9411237188036787\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Car_mAP@.5:.95                 : 0.6796980880480242\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Car_precision                  : 0.9359805984776203\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Car_recall                     : 0.8563714512119298\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Car_support                    : 4012\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Car_true_positives             : 3436.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Cyclist_f1                     : 0.7697697447394338\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Cyclist_false_positives        : 36.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Cyclist_mAP@.5                 : 0.7943251647256646\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Cyclist_mAP@.5:.95             : 0.44523733242972263\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Cyclist_precision              : 0.824019065615212\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Cyclist_recall                 : 0.7222222222222222\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Cyclist_support                : 234\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Cyclist_true_positives         : 169.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Misc_f1                        : 0.6834959867473213\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Misc_false_positives           : 18.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Misc_mAP@.5                    : 0.7051400540227198\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Misc_mAP@.5:.95                : 0.4077757321459406\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Misc_precision                 : 0.8180433806240258\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Misc_recall                    : 0.5869565217391305\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Misc_support                   : 138\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Misc_true_positives            : 81.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Pedestrian_f1                  : 0.7233557864706276\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Pedestrian_false_positives     : 40.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Pedestrian_mAP@.5              : 0.7477876596576782\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Pedestrian_mAP@.5:.95          : 0.37598771108136153\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Pedestrian_precision           : 0.9024825447735462\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Pedestrian_recall              : 0.6035598705501618\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Pedestrian_support             : 618\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Pedestrian_true_positives      : 373.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Person_sitting_f1              : 0.6766828057463122\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Person_sitting_false_positives : 3.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Person_sitting_mAP@.5          : 0.6056235554863784\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Person_sitting_mAP@.5:.95      : 0.24867511675557621\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Person_sitting_precision       : 0.7758386078386078\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Person_sitting_recall          : 0.6\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Person_sitting_support         : 20\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Person_sitting_true_positives  : 12.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Tram_f1                        : 0.8673559057869056\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Tram_false_positives           : 9.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Tram_mAP@.5                    : 0.9136194775841164\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Tram_mAP@.5:.95                : 0.6034826826495098\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Tram_precision                 : 0.8432709199456576\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Tram_recall                    : 0.8928571428571429\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Tram_support                   : 56\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Tram_true_positives            : 50.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Truck_f1                       : 0.8898567596031118\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Truck_false_positives          : 10.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Truck_mAP@.5                   : 0.9087400131644587\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Truck_mAP@.5:.95               : 0.6535117321311728\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Truck_precision                : 0.933808045584797\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Truck_recall                   : 0.8498567844953387\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Truck_support                  : 166\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Truck_true_positives           : 141.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Van_f1                         : 0.8257247626610202\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Van_false_positives            : 37.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Van_mAP@.5                     : 0.8787534099665849\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Van_mAP@.5:.95                 : 0.6245179715365243\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Van_precision                  : 0.898931184525999\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Van_recall                     : 0.7635438996614557\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Van_support                    : 431\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Van_true_positives             : 329.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     loss [418]                     : (0.8906535506248474, 3.8253629207611084)\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     metrics/mAP_0.5 [32]           : (0.1303677381002538, 0.8119447750922179)\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     metrics/mAP_0.5:0.95 [32]      : (0.04863560235322236, 0.5048408738845174)\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     metrics/precision [32]         : (0.19794786539682452, 0.869530120765333)\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     metrics/recall [32]            : (0.1286587244738277, 0.7357499441927227)\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     train/box_loss [32]            : (0.03233793005347252, 0.08068929612636566)\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     train/cls_loss [32]            : (0.005393561907112598, 0.03295833617448807)\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     train/obj_loss [32]            : (0.03012920543551445, 0.047607604414224625)\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     val/box_loss [32]              : (0.03070792369544506, 0.06217235326766968)\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     val/cls_loss [32]              : (0.004994432907551527, 0.024824200198054314)\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     val/obj_loss [32]              : (0.0448329821228981, 0.06004125252366066)\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     x/lr0 [32]                     : (0.0013375000000000001, 0.07011450381679389)\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     x/lr1 [32]                     : (0.0013375000000000001, 0.008751351781170483)\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     x/lr2 [32]                     : (0.0013375000000000001, 0.008751351781170483)\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m   Others:\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Name                        : exp\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     Run Path                    : nagasaki-soyorin/baseline-yolov5s-70-train-30-test/6d66f03bc72d4b6fad533a18650f97a3\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     comet_log_batch_metrics     : False\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     comet_log_confusion_matrix  : True\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     comet_log_per_class_metrics : True\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     comet_max_image_uploads     : 100\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     comet_mode                  : online\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     comet_model_name            : yolov5\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hasNestedParams             : True\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m   Parameters:\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     anchor_t            : 4.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     artifact_alias      : latest\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     batch_size          : 16\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     box                 : 0.05\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     bucket              : \n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     cache               : None\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     cls                 : 0.05000000000000001\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     cls_pw              : 1.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     copy_paste          : 0.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     cos_lr              : False\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     degrees             : 0.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     device              : \n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     entity              : None\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     evolve              : None\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     evolve_population   : data/hyps\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     exist_ok            : False\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     fl_gamma            : 0.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     fliplr              : 0.5\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     flipud              : 0.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     freeze              : [0]\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hsv_h               : 0.015\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hsv_s               : 0.7\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hsv_v               : 0.4\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|anchor_t        : 4.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|box             : 0.05\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|cls             : 0.5\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|cls_pw          : 1.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|copy_paste      : 0.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|degrees         : 0.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|fl_gamma        : 0.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|fliplr          : 0.5\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|flipud          : 0.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|hsv_h           : 0.015\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|hsv_s           : 0.7\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|hsv_v           : 0.4\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|iou_t           : 0.2\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|lr0             : 0.01\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|lrf             : 0.01\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|mixup           : 0.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|momentum        : 0.937\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|mosaic          : 1.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|obj             : 1.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|obj_pw          : 1.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|perspective     : 0.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|scale           : 0.5\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|shear           : 0.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|translate       : 0.1\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|warmup_bias_lr  : 0.1\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|warmup_epochs   : 3.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|warmup_momentum : 0.8\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     hyp|weight_decay    : 0.0005\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     image_weights       : False\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     imgsz               : 640\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     iou_t               : 0.2\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     label_smoothing     : 0.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     local_rank          : -1\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     lr0                 : 0.01\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     lrf                 : 0.01\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     mixup               : 0.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     momentum            : 0.937\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     mosaic              : 1.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     multi_scale         : False\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     name                : exp\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     ndjson_console      : False\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     ndjson_file         : False\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     noautoanchor        : False\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     noplots             : False\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     nosave              : False\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     noval               : False\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     obj                 : 1.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     obj_pw              : 1.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     optimizer           : SGD\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     patience            : 100\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     perspective         : 0.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     project             : runs/train\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     quad                : False\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     rect                : False\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     resume              : False\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     resume_evolve       : None\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     save_dir            : runs/train/exp\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     save_period         : -1\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     scale               : 0.5\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     seed                : 0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     shear               : 0.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     single_cls          : False\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     sync_bn             : False\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     translate           : 0.1\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     upload_dataset      : False\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     val_conf_threshold  : 0.001\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     val_iou_threshold   : 0.6\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     warmup_bias_lr      : 0.1\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     warmup_epochs       : 3.0\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     warmup_momentum     : 0.8\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     weight_decay        : 0.0005\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     weights             : yolov5s.pt\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     workers             : 8\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m   Uploads:\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     asset                        : 13 (1.94 MB)\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     conda-environment-definition : 1\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     conda-info                   : 1\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     conda-specification          : 1\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     confusion-matrix             : 1\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     environment details          : 1\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     git metadata                 : 1\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     images                       : 106\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     installed packages           : 1\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     model graph                  : 1\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m     os packages                  : 1\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m \n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m Please wait for assets to finish uploading (timeout is 10800 seconds)\n",
      "\u001b[1;38;5;39mCOMET INFO:\u001b[0m All assets have been sent, waiting for delivery confirmation\n"
     ]
    }
   ],
   "source": [
    "command = \"\"\"\n",
    "env COMET_LOG_PER_CLASS_METRICS=true python train.py \\\n",
    "--img 640 \\\n",
    "--bbox_interval 1 \\\n",
    "--cfg models/yolov5s_kitti.yaml \\\n",
    "--data data/kitti.yaml \\\n",
    "--epochs 16\n",
    "\"\"\"\n",
    "!{command}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d846b6b2-14de-4ecf-95f4-fdd8de0ed40d",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2253f3f6-f9c9-4f71-9ecf-400b2c8118c5",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e72c2674-1891-441c-9907-6199b65ff7dc",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
